package stringmethod;

import java.util.Scanner;

/**
 * @author げっしょく
 * @date 2021/7/5
 */
public class Test01 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入要遍历的字符串:");
        String s1 =sc.next();
        for(int i = 0;i<s1.length();i++){
            System.out.println("该字符串第"+(i+1)+"字符是:");
            System.out.println(s1.charAt(i));
        }
    }
}
